package com.mf.ergate.web.common.exception;

import javax.servlet.http.HttpServletResponse;

/**
 * 业务异常类
 * User: zhaoming
 * Date: 2017-08-24
 * To change this template use File | Settings | File Templates.
 */
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private Integer statusCode;
    private String errorCode;

    public BusinessException() {
        super();
        this.statusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
    }

    public BusinessException(String message) {
        super(message);
        this.statusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
    }

    public BusinessException(String errorCode, String message) {
        super(message);
        this.statusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
        this.errorCode = errorCode;
    }

    public BusinessException(Throwable cause) {
        super(cause);
        this.statusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
        this.statusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
    }

    public BusinessException(String errorCode, String message, Throwable cause) {
        super(message, cause);
        this.statusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
        this.errorCode = errorCode;
    }

    public BusinessException(Integer statusCode, String message) {
        super(message);
        this.statusCode = statusCode;
    }

    public BusinessException(Integer statusCode, String errorCode, String message) {
        super(message);
        this.statusCode = statusCode;
        this.errorCode = errorCode;
    }

    public BusinessException(Integer statusCode, Throwable cause) {
        super(cause);
        this.statusCode = statusCode;
    }

    public BusinessException(Integer statusCode, String message, Throwable cause) {
        super(message, cause);
        this.statusCode = statusCode;
    }

    public BusinessException(Integer statusCode, String errorCode, String message, Throwable cause) {
        super(message, cause);
        this.statusCode = statusCode;
        this.errorCode = errorCode;
    }

    public Integer getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(Integer statusCode) {
        this.statusCode = statusCode;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }
}
